<style>
.layui-form-pane .layui-form-label{width:auto;}
.layui-form-item{margin-bottom: 0px;}
</style>
<form class="layui-form layui-form-pane" action="{:url('mp/template/index')}" method="get" id="hisi-table-search">
<div class="layui-form-item">
 
 <div class="layui-inline">
 	<label class="layui-form-label">模板名</label>
     <div class="layui-input-inline">
         <input type="text" name="name" lay-verify="" placeholder="输入模板名" class="layui-input">
     </div>
 </div>

 <div class="layui-inline">
 	<button type="submit" class="layui-btn" lay-submit="" lay-filter="demo1">搜索</button>
 </div>
</div>
</form>


<table id="dataTable"></table>

{include file="system@block/layui" /}
<script src="__PUBLIC_JS__/jquery.2.1.4.min.js?v={:config('hisiphp.version')}"></script>
<script src="__PUBLIC_JS__/xm-select/dist/xm-select.js?v={:config('hisiphp.version')}"></script>
<script src="__PUBLIC_JS__/base64/base64.js?v={:config('hisiphp.version')}"></script>

<script type="text/html" title="操作按钮模板" id="buttonTpl">
	<a href="javascript:void(0)" class="layui-btn layui-btn-xs select-item" data-json='{{ JSON.stringify(d) }}' title="选择">选择</a>
</script>

<script type="text/javascript">
    var resData={};
    layui.use([ 'element', 'layer', 'laytpl', 'tool','laydate','table','form','flow'], function() {
        var element = layui.element;
        var layer = layui.layer;
        var $ = layui.jquery;
        var form = layui.form;
        var laytpl = layui.laytpl,laydate=layui.laydate ,table = layui.table;
        var flow = layui.flow;
        table.render({
            elem: '#dataTable'
            ,url: '{:url("mp/template/index")}' //数据接口
            ,page: true //开启分页
            ,skin: 'row'
            ,even: true
            ,limit: 20
            ,limits: [20,50,100,150,200]
            ,text: {
                none : '暂无相关数据'
            }
            ,toolbar: false
            ,cols: [[ //表头
                {field: 'id', title: '编号', sort: true}
                ,{field: 'name', title: '模板名称'}
                ,{field: '', title: '操作', templet: '#buttonTpl', fixed: 'right',width: 100}
            ]]
            ,parseData: function(res) { //res 即为原始返回的数据
                resData=res;
            }
        });
        
        $(document).on('click', '.select-item',function(){
        	var d = JSON.parse($(this).attr('data-json'));
            // parent.$('.size-list .layui-table').data('select_id',d.id);
            parent.getSizeListTemplate(d.id);
        	var index = parent.layer.getFrameIndex(window.name);
        	parent.layer.close(index);
		});
    });
</script>